﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using DbAdapter.sqldbAdapter;

namespace Water.Model
{
    /// <summary>
    /// 菜单和用户关联表
    /// </summary>
    public class UserAndMenu
    {
        public string UserName;
        public string SID;
        public string Otype;

        public int AddUserAndUser(UserAndMenu uam)
        {
            string sql = "insert into Tbt_UserAndMenu(UserName,SID) values('"+uam.UserName+"','"+uam.SID+"')";
            if (uam.Otype != "0")
            {
                sql = "delete from Tbt_UserAndMenu where UserName = '" + uam.UserName + "' and SID = '" + uam.SID + "'";
            }
            sqldb db = new sqldb();
            return db.ExecuteNonQuery(sqlconn.GetConnStr(), CommandType.Text, sql);
        }
    }
}
